package cn.like.base;

import cn.like.base.support.exception.BizException;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;
import lombok.experimental.Accessors;


import java.io.Serializable;

/**
 * desc: base entity <br>
 * details: BaseEntity
 *
 * @author like 980650920@qq.com
 * @date 2021-06-29 21:50:09
 * @see Model
 */
@Getter
@Setter
@Accessors(chain = true)
public class BaseEntity<ENTITY extends Model<ENTITY>> extends Model<ENTITY> implements Serializable, Cloneable {

	private static final long serialVersionUID = 41231316787888982L;

	@Override
	public Object clone() {
		//支持克隆  提高性能  仅仅是浅克隆
		try {
			return super.clone();
		} catch (CloneNotSupportedException e) {
			return new BizException("克隆失败");
		}
	}
	
	public static final String FIELD_ID = "id";
	public static final String CREATE_TIME = "createTime";
	public static final String CREATE_USER = "createUser";
	public static final String UPDATE_TIME = "updateTime";
	public static final String UPDATE_USER = "updateUser";
	
	
	// @TableId(value = "id", type = IdType.ASSIGN_ID)
	// @ApiModelProperty(value = "主键")
	// @NotNull(message = "id不能为空")
	// private Long id;
	// /**
	//  * 创建人id
	//  */
	// @ApiModelProperty(value = "创建人id")
	// @TableField(fill = FieldFill.INSERT)
	// private Long createUser;
	//
	// /**
	//  * 创建时间
	//  */
	// @ApiModelProperty(value = "创建时间")
	// @TableField(fill = FieldFill.INSERT)
	// private LocalDateTime createTime;
	//
	// /**
	//  * 更新人id
	//  */
	// @ApiModelProperty(value = "更新人id")
	// @TableField(fill = FieldFill.INSERT_UPDATE)
	// private Long updateUser;
	//
	// /**
	//  * 更新时间
	//  */
	// @ApiModelProperty(value = "更新时间")
	// @TableField(fill = FieldFill.INSERT_UPDATE)
	// private LocalDateTime updateTime;
}
